﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.IDAL;
using KPIS.GERP.GHRMS.DALFactory;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.IBLL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class MasCountryZoneBLL : IMasCountryZoneBLL
    {
        private static readonly IMasCountryZoneDAL dal = DataAccess.CreateMasterCountryZone();
        private MasCountryZoneInfo zoneInfo = new MasCountryZoneInfo();

        public MasCountryZoneInfo GetMasCountryZoneInfo(Nullable<int> seq)
        {
            return dal.GetMasCountryZoneInfo(seq);
        }
        public IList<MasCountryZoneInfo> ListMasCountryZones()
        {
            return dal.ListMasCountryZones(new MasCountryZoneInfo(0));
        }
        public IList<MasCountryZoneInfo> ListMasCountryZones(string Sequence)
        {
            return dal.ListMasCountryZones(new MasCountryZoneInfo(Sequence.Length > 0 ? Int32.Parse(Sequence) : 0));
        }
        public void Insert(string Name, string NameEng, string Remarks, int CreatedBy)
        {
            try
            {
                dal.Insert(new MasCountryZoneInfo(0, Name, NameEng, Remarks, CreatedBy, 0));
            }
            catch
            {
                throw new Exception("");
            }

        }
        public void Update(int Sequence, string Name, string NameEng, string Remarks, int UpdatedBy)
        {
            try
            {
                dal.Update(new MasCountryZoneInfo(Sequence, Name, NameEng, Remarks, 0, UpdatedBy));
            }
            catch
            {
                throw new Exception("");
            }

        }
        public void Delete(int Sequence, int UpdatedBy)
        {
            try
            {
                dal.Delete(new MasCountryZoneInfo(Sequence, "", "", "", 0, UpdatedBy));
            }
            catch
            {
                throw new Exception("");
            }

        }
    }
}
